define(['durandal/system', 'durandal/app'], function (system, app) {
    var ctor = function (name, description) {
        this.name = name;
        this.description = description;
    };

    ctor.prototype.canActivate = function () {
        console.log("是否激活", this.name);
        var result = app.showMessage('你想要查看' + this.name + '的详情?', '提示', [{ text: '确定', value: 'Yes' }, { text: '取消', value: 'No' }]);
        return result;
    };

    ctor.prototype.activate = function () {
        system.log('激活', this.name);
    };

    ctor.prototype.canDeactivate = function () {
        system.log('是否停止', this.name);
        var result = app.showMessage('你想要离开 ' + this.name + '的详情?', '提示', [{ text: '确定', value: 'Yes' }, { text: '取消', value: 'No' }]);
        return result;
    };

    ctor.prototype.deactivate = function () {
        system.log('停止', this.name);
    };

    return ctor;
});